package com.lantosec.hmrp.modules.system.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.lantosec.hmrp.core.mvc.BaseEntity;
import com.lantosec.hmrp.modules.system.vo.SysSmsLogVO;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.Date;

/**
 * <p>
 * 短信发送日志 实体类
 * </p>
 *
 * @author AutoCode
 * @since 2020-06-04
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
public class SysSmsLog extends BaseEntity<SysSmsLogVO> {

    private static final long serialVersionUID = 1L;
    public SysSmsLog(SysSmsLogVO vo){
        this.smsLogId = vo.getSmsLogId();
        this.moduleId = vo.getModuleId();
        this.smsPhone = vo.getSmsPhone();
        this.smsContent = vo.getSmsContent();
        this.smsCode = vo.getSmsCode();
        this.smsSendtime = vo.getSmsSendtime();

    }

    @Override
    public SysSmsLogVO convertToVO(){
        return new SysSmsLogVO(this);
    }


    /**
     * 短信发送日志ID
     */
    @TableId(value = "sms_log_id", type = IdType.AUTO)
    private Integer smsLogId;

    /**
     * 功能模块ID
     */
    private String moduleId;

    /**
     * 短信接收号码
     */
    private String smsPhone;

    /**
     * 短信内容
     */
    private String smsContent;

    /**
     * 短信平台返回代码
     */
    private String smsCode;

    /**
     * 短信发送时间
     */
    private Date smsSendtime;

    @TableField(exist = false)
    private Integer flag;


    public enum ColName {
        sms_log_id, module_id, sms_phone, sms_content, sms_code, sms_sendtime, 
    }
}
